3.2526 \(\int x^{-1-n} \left (a+b x^n\right )^2 \, dx\)

Optimal. Leaf size=30 \[ -\frac{a^2 x^{-n}}{n}+2 a b \log (x)+\frac{b^2 x^n}{n} \]

[Out]

-(a^2/(n*x^n)) + (b^2*x^n)/n + 2*a*b*Log[x]

_______________________________________________________________________________________

Rubi [A]  time = 0.0457713, antiderivative size = 30, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 17, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.118 \[ -\frac{a^2 x^{-n}}{n}+2 a b \log (x)+\frac{b^2 x^n}{n} \]

Antiderivative was successfully verified.

[In]  Int[x^(-1 - n)*(a + b*x^n)^2,x]

[Out]

-(a^2/(n*x^n)) + (b^2*x^n)/n + 2*a*b*Log[x]

_______________________________________________________________________________________

Rubi in Sympy [F]  time = 0., size = 0, normalized size = 0. \[ - \frac{a^{2} x^{- n}}{n} + \frac{2 a b \log{\left (x^{n} \right )}}{n} + \frac{\int ^{x^{n}} b^{2}\, dx}{n} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate(x**(-1-n)*(a+b*x**n)**2,x)

[Out]

-a**2*x**(-n)/n + 2*a*b*log(x**n)/n + Integral(b**2, (x, x**n))/n

_______________________________________________________________________________________

Mathematica [A]  time = 0.028202, size = 30, normalized size = 1. \[ -\frac{a^2 x^{-n}}{n}+2 a b \log (x)+\frac{b^2 x^n}{n} \]

Antiderivative was successfully verified.

[In]  Integrate[x^(-1 - n)*(a + b*x^n)^2,x]

[Out]

-(a^2/(n*x^n)) + (b^2*x^n)/n + 2*a*b*Log[x]

_______________________________________________________________________________________

Maple [A]  time = 0.021, size = 43, normalized size = 1.4 \[{\frac{1}{{{\rm e}^{n\ln \left ( x \right ) }}} \left ({\frac{{b}^{2} \left ({{\rm e}^{n\ln \left ( x \right ) }} \right ) ^{2}}{n}}+2\,ab\ln \left ( x \right ){{\rm e}^{n\ln \left ( x \right ) }}-{\frac{{a}^{2}}{n}} \right ) } \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int(x^(-1-n)*(a+b*x^n)^2,x)

[Out]

(b^2/n*exp(n*ln(x))^2+2*a*b*ln(x)*exp(n*ln(x))-a^2/n)/exp(n*ln(x))

_______________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \[ \text{Exception raised: ValueError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((b*x^n + a)^2*x^(-n - 1),x, algorithm="maxima")

[Out]

Exception raised: ValueError

_______________________________________________________________________________________

Fricas [A]  time = 0.225097, size = 46, normalized size = 1.53 \[ \frac{2 \, a b n x^{n} \log \left (x\right ) + b^{2} x^{2 \, n} - a^{2}}{n x^{n}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((b*x^n + a)^2*x^(-n - 1),x, algorithm="fricas")

[Out]

(2*a*b*n*x^n*log(x) + b^2*x^(2*n) - a^2)/(n*x^n)

_______________________________________________________________________________________

Sympy [A]  time = 137.979, size = 175, normalized size = 5.83 \[ \begin{cases} a^{2} x + 2 a b \log{\left (x \right )} - \frac{b^{2}}{x} & \text{for}\: n = -1 \\\left (a + b\right )^{2} \log{\left (x \right )} & \text{for}\: n = 0 \\- \frac{a^{2} n}{n^{2} x^{n} + n x^{n}} - \frac{a^{2}}{n^{2} x^{n} + n x^{n}} + \frac{2 a b n^{2} x^{n} \log{\left (x \right )}}{n^{2} x^{n} + n x^{n}} + \frac{2 a b n x^{n} \log{\left (x \right )}}{n^{2} x^{n} + n x^{n}} + \frac{2 a b n x^{n}}{n^{2} x^{n} + n x^{n}} + \frac{b^{2} n x^{2 n}}{n^{2} x^{n} + n x^{n}} + \frac{b^{2} x^{2 n}}{n^{2} x^{n} + n x^{n}} & \text{otherwise} \end{cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(x**(-1-n)*(a+b*x**n)**2,x)

[Out]

Piecewise((a**2*x + 2*a*b*log(x) - b**2/x, Eq(n, -1)), ((a + b)**2*log(x), Eq(n,
 0)), (-a**2*n/(n**2*x**n + n*x**n) - a**2/(n**2*x**n + n*x**n) + 2*a*b*n**2*x**
n*log(x)/(n**2*x**n + n*x**n) + 2*a*b*n*x**n*log(x)/(n**2*x**n + n*x**n) + 2*a*b
*n*x**n/(n**2*x**n + n*x**n) + b**2*n*x**(2*n)/(n**2*x**n + n*x**n) + b**2*x**(2
*n)/(n**2*x**n + n*x**n), True))

_______________________________________________________________________________________

GIAC/XCAS [A]  time = 0.221215, size = 51, normalized size = 1.7 \[ \frac{{\left (2 \, a b n e^{\left (n{\rm ln}\left (x\right )\right )}{\rm ln}\left (x\right ) + b^{2} e^{\left (2 \, n{\rm ln}\left (x\right )\right )} - a^{2}\right )} e^{\left (-n{\rm ln}\left (x\right )\right )}}{n} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((b*x^n + a)^2*x^(-n - 1),x, algorithm="giac")

[Out]

(2*a*b*n*e^(n*ln(x))*ln(x) + b^2*e^(2*n*ln(x)) - a^2)*e^(-n*ln(x))/n